package com.example.demo.util;

import tk.mybatis.mapper.genid.GenId;

public class IDUtil implements GenId<Long> {

	static SnowflakeKeyGenerator snowflakeKeyGenerator;

	static {
		System.err.println(11111111);
		snowflakeKeyGenerator = SpringBeanUtil.getBean(SnowflakeKeyGenerator.class);
	}

	@Override
	public Long genId(String table, String column) {
		return snowflakeKeyGenerator.nextId();
	}

	public static Long getId() {
		return snowflakeKeyGenerator.nextId();
	}
}
